package gof.com.yew.factory.simpleFactory;
/**
 * 简单工厂(静态工厂)：用来生产同一等级结构中的任意产品
 * 增加产品，需要修改该类
 * @author yw
 */
public class CarSimpleFactory {
	
	public static Car createCar(String type) {
		Car car = null;
		if("Audi".equals(type)) {
			car = new Audi();
		}else if("Byd".equals(type)) {
			car = new Byd();
		}else {
			throw new RuntimeException("无此车");
		}
		return car;
	}
	
	public static Audi createAudiCar() {
		return new Audi();
	}
	
	public static Byd createBydCar() {
		return new Byd();
	}
}
